<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="../../util/taglib.jsp" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>管理员详细信息页面</title>
</head>
<body>
   <div id="adminDetailPage">
        <div class="form-Container">
            <form action="#"  id="dataForm" class="grayForm" method="post">
                <input type="hidden" name="id" id="dataId" value="${param.id }">
                <input type="hidden" name="userUUID" id="userUUID" value="${param.userUUID }">
                <table>
                    <tr>
                        <td style="width:120px;"><label for="uuid">编号:</label></td>
                        <td style="line-height:20px;"><span id="uuid"></span></td>
                        <td style="width:120px;"><label for="userName">用户名:</label></td>
                        <td style="line-height:20px;"><span id="userName"></span></td>
                    </tr>
                    <tr>
                        <td ><label for="realName">真实姓名:</label></td>
                        <td style="line-height:20px;"><span id="realName"></span></td>
                        <td ><label for="companyName">所在单位:</label></td>
                        <td style="line-height:20px;">
                           <span id="companyName"></span>
                        </td>
                    </tr>
                    <tr>
                        <td ><label for="deptName">所属部门:</label></td>
                        <td style="line-height:20px;">
                           <span id="deptName"></span>
                        </td>
                        <td ><label for="positionName">所属职位:</label></td>
                        <td style="line-height:20px;">
                          <span id="positionName"></span>
                        </td>
                    </tr>
                    <tr>
                        <td ><label for="email">E-mail:</label></td>
                        <td style="line-height:20px;"><span id="email"></span></td>
                        <td ><label for="workTel">工作电话:</label></td>
                        <td style="line-height:20px;"><span id="workTel"></span></td>
                    </tr>
                     <tr>
                        <td ><label for="mobileTel">手机号码:</label></td>
                        <td colspan="3"  style="line-height:20px;"><span id="mobileTel"></span></td>
                    </tr>
                    <tr>
                        <td ><label for="groupName">权限角色:</label></td>
                        <td style="line-height:20px;">
                          <span id="groupName"></span>
                        </td>
                        <td ><label for="status">状态:</label></td>
                        <td style="line-height:20px;">
                           <span id="status"></span>
                        </td>
                    </tr>
                    <tr>
                        <td><label for="locked">用户锁:</label></td>
                        <td  colspan="3" style="line-height:20px;">
                           <span id="locked"></span>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
</div>
        <script type="text/javascript">
        $(document).ready(function () {
        	var dataId = $("#dataId").val();
        	var userUUID = $("#userUUID").val();
        	if(dataId!=""){
            	loadFormData(dataId);
        	}
        	
        	if(userUUID!=""){
            	loadFormData(userUUID);
        	}
        });
        
        //加载详细信息
        function loadFormData(dataId){
        	$.post(getBasePath()+"/adminUser/js/getAdminDetail.do",{id:dataId},function(jsonData){
        		if(jsonData.code=="00"){
        			for(var jsonKey in jsonData.data){
            			try{
            				var keyValue = jsonData.data[jsonKey];
            				if(jsonKey=="status"){
            					if(keyValue==0){
            						keyValue = "<font color=green><b>正常用户</b></font>";
            					}else if(keyValue==1){
            						keyValue = "<font color=red><b>被屏蔽用户</b></font>";
            					}
            				}
            				
            				if(jsonKey=="locked"){
            					if(keyValue==0){
            						keyValue = "<font color=green><b>未锁</b></font>";
            					}else if(keyValue==1){
            						keyValue = "<font color=red><b>已锁</b></font>";
            					}
            				}
            				$("#adminDetailPage #"+jsonKey).html(keyValue);
            			}catch (e) {
            				
    					}
            		}
        		}else{
        			$.messager.alert('Error',jsonData.msg);
        		}
  		    },"json");
        }
    </script>
</body>
</html>